package starcoast.bocai.com.starcoast.fragments;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import butterknife.Bind;
import butterknife.ButterKnife;
import starcoast.bocai.com.starcoast.R;
import starcoast.bocai.com.starcoast.activitys.work.MobileOfficeActivity;
import starcoast.bocai.com.starcoast.activitys.work.LegalActivity;
import starcoast.bocai.com.starcoast.activitys.work.LogisticsActivity;
import starcoast.bocai.com.starcoast.activitys.work.PhoneOpenActivity;
import starcoast.bocai.com.starcoast.activitys.work.PurchaseWorkActivity;
import starcoast.bocai.com.starcoast.activitys.work.SettledEnterpriseActivity;
import starcoast.bocai.com.starcoast.common.BaseFragment;

/**
 * Created by admin on 2016/6/3.
 */
public class WorkFragment extends BaseFragment implements View.OnClickListener {
    @Bind(R.id.tv_title)
    TextView mTitleTv;
    @Bind(R.id.work_purchase)
    LinearLayout work_purchase;
    @Bind(R.id.work_logistics)
    LinearLayout work_logistics;
    @Bind(R.id.work_phone)
    LinearLayout work_phone;
    @Bind(R.id.work_legal)
    LinearLayout work_legal;
    @Bind(R.id.work_mobile)
    LinearLayout work_mobile;
    @Bind(R.id.work_settle)
    LinearLayout work_settle;
    View view;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_work, container, false);
        ButterKnife.bind(this, view);
        initView();
        return view;
    }
    public void initView(){
        mTitleTv.setText(R.string.str_frag_work);
        work_purchase.setOnClickListener(this);
        work_logistics.setOnClickListener(this);
        work_phone.setOnClickListener(this);
        work_legal.setOnClickListener(this);
        work_mobile.setOnClickListener(this);
        work_settle.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.work_purchase:
                startActivity(new Intent(getActivity(), PurchaseWorkActivity.class));
                break;
            case R.id.work_logistics:
                startActivity(new Intent(getActivity(), LogisticsActivity.class));
                break;
            case R.id.work_phone:
                startActivity(new Intent(getActivity(), PhoneOpenActivity.class));
                break;
            case R.id.work_legal:
                startActivity(new Intent(getActivity(), LegalActivity.class));
                break;
            case R.id.work_mobile:
                startActivity(new Intent(getActivity(), MobileOfficeActivity.class));
                break;
            case R.id.work_settle:
                startActivity(new Intent(getActivity(), SettledEnterpriseActivity.class));
                break;
        }
    }
}
